/* 全局自适应样式 - 统一所有页面的响应式设计 */

/* 全局字体样式和rem基准 - 响应式调整 */
html {
  font-size: 16px; /* 桌面端：1rem = 16px */
  scroll-behavior: smooth;
  overflow-x: hidden; /* 防止水平滚动 */
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 75rem = 1200px 桌面端 */
@media (min-width: 75rem) {
  html { 
    font-size: 18px; /* 大屏幕稍大字体 */
  }
}

/* 64rem = 1024px 平板端 */
@media (max-width: 64rem) {
  html { 
    font-size: 15px; /* 平板端稍小字体 */
  }
}

/* 48rem = 768px 手机端 */
@media (max-width: 48rem) {
  html { 
    font-size: 14px; /* 手机端更小字体 */
  }
}

/* 全局字体 - Lexend优先，系统字体降级 */
* {
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif !important;
  box-sizing: border-box;
}

/* 特殊情况：代码字体保持等宽字体 */
code, pre, .code, .monospace {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
}

/* CSS变量定义 - 主题色彩 */
:root {
  /* 主色调 - 蓝色系 */
  --primary-color: #0066ff;
  --primary-light: rgba(0, 102, 255, 0.1);
  --primary-dark: #0052cc;
  
  /* 文字色彩 */
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  
  /* 背景色彩 */
  --white: #ffffff;
  --background-light: #f6f8fb;
  --border-color: #f0f0f0;
  
  /* 阴影（简化设计，无复杂阴影） */
  --shadow-light: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 0.25rem 1rem rgba(0, 0, 0, 0.1);
  
  /* 过渡动画 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  
  /* 边框圆角 */
  --border-radius: 0.75rem;
  --border-radius-small: 0.5rem;
  --border-radius-large: 1rem;
}

/* 全局重置 */
body {
  margin: 0;
  padding: 0;
  background: var(--background-light);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden; /* 防止水平滚动 */
  width: 100vw; /* 确保全屏宽度 */
}

/* 全屏页面容器 */
.page-container {
  min-height: 100vh;
  width: 100vw; /* 真正全屏宽度 */
  overflow-x: hidden;
  padding-top: 4rem; /* 为导航栏留出空间 */
}

/* 标准内容容器 - 不是全屏的内容使用 */
.content-container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* 通用页面头部 */
.page-header {
  background: var(--white);
  border-bottom: 0.0625rem solid var(--border-color);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.page-header-content {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* 通用卡片样式 - 简化交互，使用translateY而非阴影 */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  border: 0.0625rem solid var(--border-color);
  padding: 1.5rem;
  transition: var(--transition-normal);
}

.card:hover {
  border-color: var(--primary-color);
  transform: translateY(-0.25rem); /* 上移效果，无阴影 */
}

/* 通用网格布局 - 自适应设计 */
.grid-container {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

/* 桌面端网格 */
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); } /* 热门推荐4列 */

/* 通用按钮样式 - 主题色设计 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-small);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  text-decoration: none;
  min-height: 2.75rem;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark); /* 背景色深化，无阴影 */
}

.btn-secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 0.0625rem solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* 通用文本样式 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }

/* 通用间距工具类 - 全部使用rem */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* 平板端响应式调整 */
@media (max-width: 64rem) {
  .content-container {
    padding: 0 1rem;
  }
  
  .page-header {
    padding: 1.5rem 0;
  }
  
  .page-header-content {
    padding: 0 1rem;
  }
  
  .page-title {
    font-size: 1.75rem;
  }
  
  .page-subtitle {
    font-size: 0.9rem;
  }
  
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  
  .grid-container {
    gap: 1rem;
    margin: 1.5rem 0;
  }
}

/* 手机端响应式调整 */
@media (max-width: 48rem) {
  .content-container {
    padding: 0 0.75rem;
  }
  
  .page-header {
    padding: 1rem 0;
  }
  
  .page-header-content {
    padding: 0 0.75rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .page-subtitle {
    font-size: 0.85rem;
  }
  
  .grid-4,
  .grid-3,
  .grid-2 { 
    grid-template-columns: 1fr; 
  }
  
  .card {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
  }
}

/* 加载状态动画 */
.loading {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 0.125rem solid rgba(0, 102, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

.loading::after {
  content: '';
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.5rem;
  border-radius: 50%;
  border: 0.3125rem solid transparent;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* 滚动条样式优化 */
::-webkit-scrollbar {
  width: 0.375rem;
  height: 0.375rem;
}

::-webkit-scrollbar-track {
  background: var(--background-light);
  border-radius: 0.1875rem;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 0.1875rem;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Firefox滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--background-light);
}

/* 确保输入框和按钮也使用Lexend字体 */
input, textarea, button, select {
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif !important;
}

/* Ant Design组件字体覆盖 */
.ant-btn, .ant-input, .ant-select, .ant-menu, .ant-tabs, .ant-card, .ant-list, .ant-table {
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif !important;
}

/* 强制所有元素使用Lexend字体 */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video,
button, input, textarea, select, option {
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif !important;
}

/* Ant Design 组件字体覆盖 */
.ant-btn, .ant-input, .ant-select, .ant-menu, .ant-dropdown,
.ant-card, .ant-list, .ant-table, .ant-pagination,
.ant-modal, .ant-drawer, .ant-tooltip, .ant-popover,
.ant-notification, .ant-message, .ant-alert,
.ant-form, .ant-checkbox, .ant-radio, .ant-switch,
.ant-slider, .ant-rate, .ant-upload, .ant-progress,
.ant-tag, .ant-badge, .ant-avatar, .ant-anchor,
.ant-breadcrumb, .ant-steps, .ant-tabs, .ant-collapse,
.ant-carousel, .ant-calendar, .ant-date-picker,
.ant-time-picker, .ant-transfer, .ant-tree,
.ant-tree-select, .ant-cascader, .ant-auto-complete,
.ant-mention, .ant-spin, .ant-back-top, .ant-divider,
.ant-layout, .ant-affix, .ant-grid {
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif !important;
}

/* 代码相关元素保持等宽字体 */
code, pre, .code, .monospace, 
kbd, samp, var, tt,
.ant-typography code {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
}

/* 通用样式 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  color: #333333;
  overflow-x: hidden;
}

/* 链接样式 */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #0066ff;
}

/* 按钮重置 */
button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  outline: none;
}

/* 输入框重置 */
input, textarea, select {
  border: none;
  outline: none;
  background: none;
  font-size: inherit;
}

/* 列表重置 */
ul, ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 图片响应式 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 选中文本样式 */
::selection {
  background-color: rgba(0, 102, 255, 0.2);
  color: #333;
}

::-moz-selection {
  background-color: rgba(0, 102, 255, 0.2);
  color: #333;
}

/* 焦点样式 */
:focus-visible {
  outline: 2px solid #0066ff;
  outline-offset: 2px;
}

/* 禁用状态 */
[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 隐藏类 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 响应式工具类 */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  
  .mobile-only {
    display: block;
  }
}

/* 动画性能优化 */
* {
  will-change: auto;
}

.animate {
  will-change: transform, opacity;
}

/* 打印样式 */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a, a:visited {
    text-decoration: underline;
  }
  
  .no-print {
    display: none !important;
  }
} 